package com.codeman.business.book.domain;

import com.codeman.common.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Date;

/**
 * 小说目录对象 book_index
 *
 * @author codeman
 * @date 2021-03-24
 */
@Data
public class BookIndex {
    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    /**
     * 小说ID
     */
    @Excel(name = "小说ID")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long bookId;

    /**
     * 目录号
     */
    @Excel(name = "目录号")
    private Integer indexNum;

    /**
     * 目录名
     */
    @Excel(name = "目录名")
    private String indexName;

    /**
     * 字数
     */
    @Excel(name = "字数")
    private Integer wordCount;

    /**
     * 是否收费，1：收费，0：免费
     */
    @Excel(name = "是否收费，1：收费，0：免费")
    private String isVip;

    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;
    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("bookId", getBookId())
                .append("indexNum", getIndexNum())
                .append("indexName", getIndexName())
                .append("wordCount", getWordCount())
                .append("isVip", getIsVip())
                .append("createTime", getCreateTime())
                .append("updateTime", getUpdateTime())
                .toString();
    }
}
